package com.xoa.controller.party;


import com.xoa.model.party.Point;
import com.xoa.service.party.PointService;
import com.xoa.util.ToJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by crr on 2018/4/20.
 */

/**
 * 点位
 */
@Controller
@RequestMapping("/point")
public class PointController {
    @Autowired
    PointService pointService;

    /**郭心雨
     * 2018.4.20
     * 根据布控点位id查看所属点位的信息
     * @param conId
     */
    @ResponseBody
    @RequestMapping("/getPointByConId")
    public ToJson<Point> getPointByConId(String conId, Integer page, Integer pageSize){
        return pointService.getPointByConId(Integer.parseInt(conId),page,pageSize);
    }

    /**
     * 郭心雨
     * 2018.4.20
     * 根据id修改
     * @param point
     */
    @ResponseBody
    @RequestMapping("/updateExecuteById")
    public ToJson updateExecuteById(Point point){
        return pointService.updateExecuteById(point);
    }

    /**
     * 郭心雨
     * 2018.4.20
     * 添加
     * @param point
     */
    @ResponseBody
    @RequestMapping("/addExecute")
    public ToJson addExecute(Point point){
        return pointService.addExecute(point);
    }

    /**
     * 郭心雨
     * 2018.4.20
     * 删除
     * @param pId
     */
    @ResponseBody
    @RequestMapping("/delExecute")
    public ToJson delExecute(Integer pId){
        return pointService.delExecute(pId);
    }

    @ResponseBody
    @RequestMapping("/selectByPrimaryKey")
    public ToJson selectByPrimaryKey(Integer ponitId){
        return pointService.selectByPrimaryKey(ponitId);
    }

}
